/*
    Space Simulation - Simulate the solar system
    Copyright (C) 2010  Guillaume Andrieu and Sylvain Martin

    This file is part of Space Simulation.

    Space Simulation is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Space Simulation is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Space Simulation.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 /*
 *Simulation.h : contiens la definition de la structure simulation et les en-tetes des fonctions de 
 *		 Simulation.c
 *
 */


#ifndef _IMA4_SIMULATION_H

#define _IMA4_SIMULATION_H


#include <stdio.h>
#include <string.h>
#include <time.h>

#include "Particule.h"

typedef struct Space Space;
struct Space
{
  /* Constante gravitationelle */
 double G;
 double time;
};

typedef struct Simulation Simulation;
struct Simulation
 {
   Space space;
   
   Particule * particules;
   int particules_num;
   
   /* Increment de temps */
   double time_step;
   
   /* Vitesse de simulation
      speed = 1 pour du temps reel */
   double speed;
   
   /* Temps de départ */
   time_t start_time;
 };
 
 /*
 * Global Variable
 */
Simulation simul;

/*
 * Fonctions constructeur
 */
Simulation MakeSimulation(Space space, time_t start_time, double time_step, double speed);

/*
 * Mise a jour de la simulation
 */
void updateSimulation(Simulation * s, double exec_time);

/*
 * Ajout d'une particule a une simulation
 */
void addParticule(Simulation * s, Particule p);

#endif
